package com.common.bean2;

/**
 * @hibernate.class table="t2" batch-size="5"
 * @author wq
 */
public class T2 {
	/**
	 * @hibernate.id
	 * generator-class="native"
	 */
	private Long id;
	/**
	 * @hibernate.property
	 */
	private String name;
	/**
	 * @hibernate.many-to-one column="t3id" class="com.common.bean2.T3"
	 * cascade="none"
	 */
	private T3 t3;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public T3 getT3() {
		return t3;
	}
	public void setT3(T3 t3) {
		this.t3 = t3;
	}
	@Override
	public int hashCode() {
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + ((id == null) ? 0 : id.hashCode());
		result = PRIME * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final T2 other = (T2) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
		
}
